<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    const lessons = [
        {
            title: "媒体查询响应式布局",
            category: "css"
        },
        {
            title: "FLEX 弹性盒模型",
            category: "css"
        },
        {
            title: "MYSQL多表查询随意操作",
            category: "mysql"
        }
    ];
    const proxy = new Proxy(lessons, {
        get(target, key) {
            const title = target[key].title;
            const len = 5;
            target[key].title = title.length > 5 ? title.substr(0, len) + '.'.repeat(3) : title

            return target[key];
        }
    })
    console.log(proxy[0])
</script>